from collections import defaultdict
users=['bobby1','bobby2','bobby3','bobby1','bobby2','bobby2']

user_dict={}
for user in users:
    user_dict.setdefault(user,0)
    user_dict[user]+=1
print(user_dict)

default_dict=defaultdict(int)
for user in users:
    default_dict[user]+=1
print(default_dict)

def gen_default():
    return {
        'name':'',
        'number':0
    }
default_dict=defaultdict(gen_default)
print(default_dict[''])
